/*
	结构体作为函数的参数
*/

#include <stdio.h>
//定义结构体
struct Computer{
	char name[20];
	double price;
	};
//定义一个函数实现对结构体变量的读取
struct Computer read(struct Computer c){
		printf("请输入一个电脑信息：\n");
		scanf("%s%lf",c.name,&c.price);
		return c;
	}
void write(struct Computer c){
		printf("电脑信息中，型号%s，价格%lf\n",c.name,c.price);	
	}
	
struct Computer input(void){
		struct Computer cc;
		printf("请输入电脑型号和价格\n");
		scanf("%s%lf",cc.name,&cc.price);
		return cc;
	}
			 

void print(struct Computer* pc){
		printf("电脑信息内容，型号%s，价钱：%lf \n",pc -> name,pc->price);
	}
int main(void){
	struct 	Computer computer;
	struct 	Computer cc;
	//read(computer);
	//computer = read(computer);
	//write(computer);
	cc = input();
	print(&cc);
	return 0;
	}
